﻿@model BTKERP.MVCWeb.Models.GRNManager

@{
    ViewBag.Title = "GRN Details";
}
<a href="../Index" class="btn btn-blue">Back To List</a>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>GRN General</legend>
        <div class="box box-info">
            <b>Code : </b>@Html.DisplayFor(model => model.Master.GRNCode) &nbsp&nbsp
            <b>GRN Date : </b>@Html.DisplayFor(model => model.Master.GRNDate.Day)<br />
            <b>Supplier : </b> @BTKERP.MVCWeb.AppCode.DataRefHelper.GetSupplierById(Model.Master.SupplierId) &nbsp&nbsp
            <b>Received Warehouse : </b> @BTKERP.MVCWeb.AppCode.DataRefHelper.GetWarehouseById(Model.Master.ReceivedWarehouseId)
        </div>
         <p>
            <input  type="submit" name="submitButton" value="Print" class="btn btn-green" />
        </p>
    </fieldset>
    
}
<fieldset>
<legend>Received</legend>
<table id="dt" class="display stylized">
    <tr>
        <th>
            Product
        </th>
        <th>
            Unit
        </th>
        <th>
            Quantity
        </th>
        <th>
            Unit Cost
        </th>
        <th>
            Total
        </th>
    </tr>

@foreach (var item in Model.Details)
{
    <tr>
        <td>
            @BTKERP.MVCWeb.AppCode.DataRefHelper.GetProductNameById(item.ProductId)

        </td>
        <td>
            @BTKERP.MVCWeb.AppCode.DataRefHelper.GetUnitById(item.UnitId)
        </td>
         <td>
            @Html.DisplayFor(modelItem => item.Quantity)
        </td>
         <td>
            @Html.DisplayFor(modelItem => item.UnitCost)
        </td>
         <td>
            @Html.DisplayFor(modelItem => item.Quantity * item.UnitCost)
        </td>
    </tr>
}

</table>
</fieldset>
<div>
    <b>@Html.ActionLink("Back to List", "Index")</b>
</div>
